/**
 * 设置 默认年份和改变年份
 */
export const HandleYearMonthMixin = {
  methods:{
    setYear() {
      this.queryParam.year = new Date().getFullYear()
    },
    handleYear(value) {
      this.queryParam.year = value;
      this.$forceUpdate();
    },
    setMonth() {
      this.queryParam.month = (new Date().getMonth() + 1).toString.length < 2
        ? "0" + (new Date().getMonth() +1) : new Date().getMonth() + 1
    },
    handleMonth(value) {
      this.queryParam.month = value;
      this.$forceUpdate();
    },
    setTagIds() {
      let month = (new Date().getMonth() + 1).toString.length < 2
        ?  "0" + (new Date().getMonth() +1) : new Date().getMonth() + 1
      this.tagIds.push(month.toString())
    },
    handleChange(val) {
      this.tagIds = val
      this.queryParam.month = val.join(',')
    }
  }
}